/**
 * @file categories/graph/bfs/cf1037d/main.cpp
 * @brief
 * @see
 * @author Ruiming Guo (guoruiming@stu.scu.edu.cn)
 * @copyright 2022
 * @date 2022/7/5 18:59:10
 **/

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
const int N = 200007;
vector<int> adj[N];
int inputorder[N], relorder[N];
bool vis[N];
vector<int> ans;
int main() {
  // High rating and good luck!
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  int n, x, a, b, i, j;
  cin >> n;
  for (i = 0; i < n - 1; ++i) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  for (i = 0; i < n; ++i) {
    cin >> inputorder[i];
    relorder[inputorder[i]] = i;
  }
  for (i = 1; i <= n; ++i)
    sort(adj[i].begin(), adj[i].end(),
         [](int a, int b) { return relorder[a] < relorder[b]; });
  queue<int> q;
  q.push(1);
  while (!q.empty()) {
    queue<int> temp;
    while (!q.empty()) {
      x = q.front();
      q.pop();
      ans.push_back(x);
      vis[x] = true;
      for (j = 0; j < adj[x].size(); ++j) {
        if (vis[adj[x][j]] == false) temp.push(adj[x][j]);
      }
    }
    q = temp;
  }
  for (i = 0; i < n; ++i)
    if (inputorder[i] != ans[i]) {
      cout << "No" << endl;
      return 0;
    }
  cout << "Yes" << endl;
  return 0;
}
